package com.play.ballen.network

import com.play.ballen.data.LoginResult
import com.play.ballen.data.PImGroup
import com.play.ballen.data.PImGroupStatus
import com.play.ballen.data.UserBean
import com.play.ballen.home.entity.*
import com.play.ballen.mall.entity.MallRecordInfo
import com.play.ballen.mall.entity.MallSaleInfo
import com.play.ballen.mall.entity.RateInfo
import com.play.ballen.me.entity.*
import com.play.ballen.pack.entity.PackBallSellInfo
import com.play.ballen.pack.entity.PackInfo
import com.play.ballen.synthetic.entity.*
import io.reactivex.Observable
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part
import retrofit2.http.Path
import retrofit2.http.Query
import retrofit2.http.QueryMap

interface ApiService {

    @POST(ApiUri.SEND_CODE)
    fun sendCode(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @POST(ApiUri.REGISTER)
    fun register(@Body requestBody: RequestBody): Observable<BaseResult<LoginResult>>

    @POST(ApiUri.LOGIN)
    fun login(@Body requestBody: RequestBody): Observable<BaseResult<LoginResult>>


    @POST(ApiUri.LOGINALI)
    fun loginali(@Body requestBody: RequestBody): Observable<BaseResult<LoginResult>>

    @POST(ApiUri.FORGET)
    fun forgetPwd(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @GET(ApiUri.PRIVACY)
    fun getPrivacy(): Observable<BaseResult<String>>

    @GET(ApiUri.LOGOUT)
    fun logout(): Observable<BaseResult<Any?>>

    @GET(ApiUri.INDEX)
    fun index(): Observable<BaseResult<HomeIndexInfo?>>

    @GET(ApiUri.ARTICLE)
    fun getArticleList(@QueryMap params: MutableMap<String, Any>): Observable<BaseResult<List<ArticleInfo>?>>

    @GET(ApiUri.ARTICLE_DETAIL)
    fun getArticleDetail(@Query("id") id: String): Observable<BaseResult<ArticleInfo>>

    @GET(ApiUri.MEMBER_INDEX)
    fun getMemberIndex(): Observable<BaseResult<MemberIndexInfo>>

    @GET(ApiUri.WITHDRAW)
    fun getWithDrawInfo(): Observable<BaseResult<WithDrawInfo>>

    @POST(ApiUri.WITHDRAW)
    fun commitWithDraw(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @GET(ApiUri.MONEY_LOG)
    fun moneyLog(@QueryMap params: MutableMap<String, Any>): Observable<BaseResult<List<MoneyLogInfo>?>>

    @GET(ApiUri.SERVICE)
    fun service(): Observable<BaseResult<ServiceInfo>>

    @GET(ApiUri.RECHARGE)
    fun recharge(): Observable<BaseResult<RechargeInfo>>

    @POST(ApiUri.MEMBER_EDIT)
    fun memberEdit(@Body requestBody: RequestBody): Observable<BaseResult<UserInfo>>

    @GET(ApiUri.EXTRACT)
    fun extraInfo(@Query("type") type: String): Observable<BaseResult<ExtraInfo>>

    @POST(ApiUri.EXTRACT)
    fun extraConfirm(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>




    @GET(ApiUri.TEAM)
    fun team(@QueryMap params: MutableMap<String, Any>): Observable<BaseResult<TeamInfo>>

    @GET(ApiUri.INVITE_POSTER)
    fun invitePoster(): Observable<BaseResult<InvitePosterInfo>>

    @GET(ApiUri.BASKETBALL_INDEX)
    fun basketballIndex(@QueryMap params: MutableMap<String, Any>): Observable<BaseResult<MallSaleInfo>>

    @GET(ApiUri.BASKETBALL_BUY)
    fun basketballBuyRate(): Observable<BaseResult<RateInfo>>

    @POST(ApiUri.BASKETBALL_BUY)
    fun basketballBuy(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @POST(ApiUri.BASKETBALL_BUY_SELL)
    fun basketballBuySell(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @GET(ApiUri.BASKETBALL_LOG)
    fun basketballLog(@QueryMap params: MutableMap<String, Any>): Observable<BaseResult<List<MallRecordInfo>?>>

    @GET(ApiUri.MEMBER_BASKETBALL)
    fun memberBasketBall(@QueryMap params: MutableMap<String, Any>): Observable<BaseResult<PackInfo>>

    @GET(ApiUri.BASKETBALL_SELL)
    fun basketballSell(@Query("id") id: String): Observable<BaseResult<PackBallSellInfo>>

    @POST(ApiUri.BASKETBALL_SELL)
    fun basketballSellConfirm(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @POST(ApiUri.BASKETBALL_SELL_CANCEL)
    fun basketballSellCancel(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @GET(ApiUri.COMBO_LIST)
    fun getSyntheticList(): Observable<BaseResult<List<SyntheticBallInfo>?>>


    @GET(ApiUri.GUESS_INFO_LIST)
    fun getGuessInfoList(): Observable<BaseResult<GuessInfo>>


    @GET(ApiUri.GUESS_NOTIFY)
    fun getNotice(): Observable<BaseResult<Notice>>

    @GET(ApiUri.GUESS_LOG)
    fun getGuessLog(@QueryMap params: MutableMap<String, Any>): Observable<BaseResult<List<Guess>>>


    @GET(ApiUri.COMBO)
    fun getSyntheticInfo(@Query("id") id: String): Observable<BaseResult<SyntheticInfo>>

    @POST(ApiUri.COMBO)
    fun syntheticSubmit(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @POST(ApiUri.ADD_GUESS_NUM)
    fun syntheticGuess(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @GET(ApiUri.COMBO_LOG)
    fun syntheticRecord(@QueryMap params: MutableMap<String, Any>): Observable<BaseResult<List<SyntheticRecordInfo>?>>

    @GET(ApiUri.WIN_LOG)
    fun winRecord(@QueryMap params: MutableMap<String, Any>): Observable<BaseResult<List<SyntheticRecordInfo>?>>

    @GET(ApiUri.TASK_LOG)
    fun taskLog(@QueryMap params: MutableMap<String, Any>): Observable<BaseResult<List<PlayCountRecordInfo>?>>

    @GET(ApiUri.TASK)
    fun task(): Observable<BaseResult<PlayCountInfo?>>

    @POST(ApiUri.TASK)
    fun taskSubmit(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @GET(ApiUri.GAS)
    fun gas(): Observable<BaseResult<GasInfo?>>

    @POST(ApiUri.GAS)
    fun gasSubmit(): Observable<BaseResult<Any?>>

    @GET(ApiUri.CLAIMED_LOG)
    fun claimedLog(@QueryMap params: MutableMap<String, Any>): Observable<BaseResult<List<ClaimedInfo>?>>

    @GET(ApiUri.TRANSFER)
    fun getTransferInfo(): Observable<BaseResult<TransferInfo>>

    @POST(ApiUri.TRANSFER)
    fun commitTransfer(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @GET(ApiUri.Guess_Info)
    fun getSyntheticGuessInfo(@Query("id") id: String): Observable<BaseResult<SyntheticGuessInfo>>

    @GET(ApiUri.TOKEN)
    fun getuploadToken(): Observable<BaseResult<QINiuToken>>


    @GET(ApiUri.GET_BOTTLE+"{bottle_id}")//捞指定瓶子
    fun getBottle(@Path("bottle_id") id: String): Observable<BaseResult<BottleDetail>>


    @GET(ApiUri.SEE_BOTTLE+"{bottle_id}")//看指定瓶子
    fun seeBottle(@Path("bottle_id") id: String): Observable<BaseResult<BottleDetail>>

    @POST(ApiUri.GET_BOTTLE_SALVAGE)
    fun getBottlesalvage(@Body requestBody: RequestBody): Observable<BaseResult<BottleDetail>>

    @GET(ApiUri.GET_BOTTLE_COUNT)
    fun getCanGetNum(): Observable<BaseResult<BottleCount>>

    @GET(ApiUri.GET_USER_INFO)
    fun getUserInfo(): Observable<BaseResult<UserBean>>

    @POST(ApiUri.PUT_BOTTLE)
    fun putBottle(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @POST(ApiUri.GET_BOTTLE_WATER)
    fun getBottleWater(@Body requestBody: RequestBody): Observable<BaseResult<List<BottleList>>>

    @POST("api/user/avatar")
    fun addAvatar(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>


    @POST(ApiUri.UPDATENAME)
    fun  updateName(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @POST(ApiUri.POST_BOTTLE_COMMENT)
    fun  addComment(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @GET(ApiUri.MY_BOTTLE)
    fun getBottleList(@Query("pn") pn: Int,@Query("count") count: Int): Observable<BaseResult<List<BottleListData>?>>

    @POST(ApiUri.BOTTLE_IM_GROUP)
    fun  getPrivateGroup(@Body requestBody: RequestBody): Observable<BaseResult<PImGroup>>
    @POST(ApiUri.BOTTLE_IM_GROUP_STATUS)
    fun  getPrivateGroupStatus(@Body requestBody: RequestBody): Observable<BaseResult<MutableMap<String,List<PImGroupStatus>>>>
    @POST(ApiUri.BOTTLE_IM_GROUP_OPEN)
    fun  updateOpenId(@Body requestBody: RequestBody): Observable<BaseResult<Any>>

    @GET(ApiUri.GET_BOTTLE_COMMENT_LIKE+"{commentID}")
    fun likeComment(@Path("commentID") id: String): Observable<BaseResult<Any?>>

    @GET(ApiUri.GET_BOTTLE_COMMENT_UNLIKE+"{commentID}")
    fun unlikeComment(@Path("commentID") id: String): Observable<BaseResult<Any?>>

    @GET(ApiUri.READ+"{bottle_id}")
    fun read(@Path("bottle_id") id: String): Observable<BaseResult<Any?>>

    @POST(ApiUri.FOLLOW+"{uid}")
    fun follow(@Path("uid") id: String): Observable<BaseResult<Any?>>

    @POST(ApiUri.UN_FOLLOW+"{uid}")
    fun unfollow(@Path("uid") id: String): Observable<BaseResult<Any?>>

    @POST(ApiUri.REPORT_BOTTLE)
    fun reportBottle(@Body requestBody: RequestBody): Observable<BaseResult<Any?>>

    @POST(ApiUri.FOLLOW_BOTTLE+"{uid}")
    fun followBottle(@Path("uid") id: String): Observable<BaseResult<Any?>>

    @POST(ApiUri.UN_FOLLOW_BOTTLE+"{uid}")
    fun unfollowBottle(@Path("uid") id: String): Observable<BaseResult<Any?>>


    @DELETE(ApiUri.DELETE_COMMENT+"{uid}")
    fun deleteComment(@Path("uid") id: String): Observable<BaseResult<Any?>>


}